﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:ctb="clr-namespace:ChatTextBlockControl">
    <Style TargetType="ctb:ChatTextBlock">
        <Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
        <Setter Property="Style" Value="{StaticResource PhoneTextNormalStyle}"/>
        <Setter Property="TimestampStyle" Value="{StaticResource PhoneTextSubtleStyle}"/>
        <Setter Property="TimestampFontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
        <Setter Property="TimestampVisibility" Value="Visible"/>
        <Setter Property="TopLeftArrowVisibility" Value="Collapsed"/>
        <Setter Property="TopRightArrowVisibility" Value="Collapsed"/>
        <Setter Property="BottomLeftArrowVisibility" Value="Collapsed"/>
        <Setter Property="BottomRightArrowVisibility" Value="Collapsed"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ctb:ChatTextBlock">
                    <StackPanel x:Name="container" Margin="10,0,0,0">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Path Data="M30.003418,120.99951 L30.003418,109.46851 L46.035702,120.99951" Height="13.031" Stretch="Fill" UseLayoutRounding="False" Width="16.313"
	                            Grid.Column="0" HorizontalAlignment="Left" Margin="11,0,0,-2"
                                Fill="{TemplateBinding Background}"
                                Visibility="{TemplateBinding TopLeftArrowVisibility}"/>
                            <Path Data="M30.003418,120.99951 L30.003418,109.46851 L46.035702,120.99951" Height="13.031" Stretch="Fill" UseLayoutRounding="False" Width="16.313"
	                            Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,11,-2" RenderTransformOrigin="0.5,0.5"
                                Fill="{TemplateBinding Background}"
                                Visibility="{TemplateBinding TopRightArrowVisibility}">
                                <Path.RenderTransform>
                                    <CompositeTransform ScaleX="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <Border
                            Background="{TemplateBinding Background}">
                            <StackPanel>
                                <ContentPresenter HorizontalAlignment="Left" 
                                    Content="{TemplateBinding Content}" />
                                <TextBlock Text="{TemplateBinding TimestampText}"
                                    Style="{TemplateBinding TimestampStyle}"
                                    FontSize="{TemplateBinding TimestampFontSize}"
                                    Visibility="{TemplateBinding TimestampVisibility}"
                                    TextAlignment="Right" Margin="10,0,10,10"/>
                            </StackPanel>
                        </Border>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Path Data="M30.003418,120.99951 L30.003418,109.46851 L46.035702,120.99951" Height="13.031" Stretch="Fill" UseLayoutRounding="False" Width="16.313"
	                            Grid.Column="0" HorizontalAlignment="Left" Margin="11,-2,0,0" RenderTransformOrigin="0.5,0.5"
                                Fill="{TemplateBinding Background}"
                                Visibility="{TemplateBinding BottomLeftArrowVisibility}">
                                <Path.RenderTransform>
                                    <CompositeTransform ScaleY="-1"/>
                                </Path.RenderTransform>
                            </Path>
                            <Path Data="M30.003418,120.99951 L30.003418,109.46851 L46.035702,120.99951" Height="13.031" Stretch="Fill" UseLayoutRounding="False" Width="16.313"
	                            Grid.Column="1" HorizontalAlignment="Right" Margin="0,-2,11,0" RenderTransformOrigin="0.5,0.5"
                                Fill="{TemplateBinding Background}"
                                Visibility="{TemplateBinding BottomRightArrowVisibility}">
                                <Path.RenderTransform>
                                    <CompositeTransform ScaleY="-1" ScaleX="-1"/>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>